<?php


namespace app\demo\middleware;


use think\Response;

class Check
{
    /**
     * 模块全局
     *中间件请求调度
     * 创建中间件要在相应的模块配置才会生效
     * @param $request
     * @param \Closure $next
     * @return mixed
     */
    public function handle($request, \Closure $next){//请求+闭包
        dump(1);
        $request->type = 'tianqi';
        return $next($request);
    }

    /**
     * 中间件响应调度
     * @param Response $response
     */
    public function end(Response $response){

    }
}